# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        博智科技  
# Name:         demo0733
# Description:  可变参数 元组的形式呈现
# Author:       yzl
# Date:         2019-03-06
#-------------------------------------------------------------------------------

#def hello(*name,type='+'): # 推荐使用
def hello(type,*name):
    sum = 0
    if type == '*':
        sum = 1
    for item in name:
        if type == '+':
            sum += item
        elif type == '*':
            sum *= item

    return sum

if __name__ == '__main__':
    ret = hello('+',1,2,3,4,5,6,7)
    print(ret)

    ret = hello('*',1, 2, 3, 4)
    print(ret)

